package se.webbzon.boltzmann.player;

public enum CharacterEnum {

	Boltzmann(BoltzmannCharacter.instance()), 
	Rootsie(RootsieCharacter.instance());
	
	// The player character associated with this character enumeration
	private final PlayerCharacter character;
	
	/*============================================================
	Constructors
	============================================================*/
	
	private CharacterEnum(PlayerCharacter character) {
		this.character = character;
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	/** Returns the player character associated with this 
	 * character enumeration. **/
	public PlayerCharacter getCharacter() {
		return character;
	}
	
	/** Returns the character enumeration associated with the provided
	 * player character. If no character enumeration is associated with
	 * the provided player character then null is returned. **/
	public static CharacterEnum fromCharacter(PlayerCharacter character) {
		for (CharacterEnum e : values()) {
			if (e.getCharacter() == character)
				return e;
		}
		return null;
	}
	
}
